// pages/resume/resume.js

import { Job } from '../../../models/job'
import { Resume} from '../../../models/resume'
import {check} from "../../../util/identityCheck";

const jobModel = new Job()
const resumeModel = new Resume()
Page({
  data: {
    sex: {
      parentId: 'SEX',
      parentName: '性别',
      value: [{
        cid: 0,
        childName: '女'
      },
        {
          cid: 1,
          childName: '男'
        }]
    },
    Resume: {
      resumeName: '',
      realName: '',
      sex: '',
      birthday: '',
      phone: '',
      station: '',
      expectWages: '',
      wantedArea: '',
      wantedDescribe: '',
      workExperience: ''
    },
    hasResume: false
  },

  call () {
    wx.makePhoneCall({
      phoneNumber: this.data.Resume.phone
    })
  },

  onLoad (options) {
    if(!check())return
    resumeModel.getResumeDetail({
      resumeId: options.id
    }, res => {
      if (res) {
        this.setData({
          Resume: res,
          hasResume: true
        })
      }
    })
  },

  onReady () {

  }
})